//----------------------------------------------------------------------------------------------------------------------
// Copyright (c) 2012 James Whitworth
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the \"Software\"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//----------------------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------------------
// Base class for all code generation classes
//----------------------------------------------------------------------------------------------------------------------
class CodeGenerator
{
  static kNone            = 0x0000
  static kConst           = 0x0001
  static kReference       = 0x0002
  static kPointer         = 0x0004
  static kTemplate        = 0x0008
  static kUnused          = 0x0010
  static kInline          = 0x0020
  static kStatic          = 0x0040
  static kVirtual         = 0x0080
  static kPureVirtual     = 0x0100
  static kSpecialisation  = 0x0200

  // name of the object
  //
  name = null
  // a combination of flags for the object
  //
  flags = null

  // Set object flags to include all of _flags.
  //
  function set_flags(_flags)
  {
    flags = flags | _flags
  }

  // Does this object have all of _flags set.
  //
  function has_flags(_flags)
  {
    return ((flags & _flags) == _flags)
  }

  function is_function()
  {
    return false
  }

  // Is this object templated.
  //
  function is_templated()
  {
    return has_flags(kTemplate)
  }
  
  function is_specialisation()
  {
    return has_flags(kSpecialisation)
  }

  // Write the a declaration for this object.
  //
  function write_declaration(stream)
  {
  }

  // Write the a definition for this object.
  //
  function write_definition(stream, file_type)
  {
  }

  // Write the required template declaration(s) for this object if they are needed
  //
  function write_template(stream)
  {
  }
}